package model.service;

import model.dao.*;
import model.entity.Book;
import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;

import java.sql.Date;

public class ModServiceImpl implements ModService{

    private JdbcTemplate template;
    private ModDao modDao;
    public ModServiceImpl() {
        template=new JdbcTemplate(BaseDao.getDataSource());
        modDao=new ModDaoImpl(template);
    }
    @Override
    public void mod(Book book) {
        //System.out.println("service:"+book);
        modDao.mod(book);
    }

    @Test
    public void test()
    {
        Book book=new Book("2","22222","1",new Date(1-1-1),"1","1",1,false);
        mod(book);
    }
}
